<?php

	class Aset_fasilitas extends CI_Controller
	{
		public function __construct()
		{
			parent::__construct();
		}
		
		public function index()
		{
			$data['arr_css']	= array(
				'datatables/datatables.css'
			);
			$data['arr_js']	= array(
				'datatables/jquery.dataTables.min.js'
			);
		
			$data['active']		= 3;
			$data['title']		= 'Fasilitas';
			$data['content']	= $this->load->view('admin/aset/fasilitas/v_fasilitas',$data,true);
			$this->load->view('admin/main',$data);
		}
		
		public function json_fasilitas()
		{	
			$this->load->library('Datatables');
		
			$this->datatables
			->select('nama , id_jenis , deskripsi , id_gambar, id')
			->from('t_sekolah_fasilitas')
			->add_column('aksi', '<a href="'.site_url('smn-admin/aset_fasilitas/edit/$1').'" data-toggle="ajaxModal" class="btn btn-xs btn-default" title="Edit"><i class="fa fa-pencil"></i></a>&nbsp;<a href="'.site_url('smn-admin/aset_fasilitas/hapus/$1').'" class="btn btn-xs btn-danger btn-delete-cabang" title="Hapus"><i class="fa fa-trash-o"></i></a>', 'id');
			echo $this->datatables->generate();
		}
		
		public function add()
		{
			$data['arr_js'] 	= array(
				'wysiwyg/jquery.hotkeys.js',
				'wysiwyg/bootstrap-wysiwyg.js',
				'wysiwyg/demo.js',
			);

			$data['active']		= 3;
			$data['title']		= 'Fasilitas';
			$data['content']	= $this->load->view('admin/aset/fasilitas/n_fasilitas',$data,true);
			$this->load->view('admin/main',$data);
		}
	}